<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>更新用户</title>
<link rel = "stylesheet" href = "css/bootstrap.min.css">
<link rel = "stylesheet" href = "css/bootstrap.theme.min.css">
<script type = "text/javascript" src = "js/jquery.min.js"></script>
<script type="text/javascript" src = "js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/checkUpdateUser.js"></script>
</head>
<body>
<nav class="navbar navbar-default">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="index.jsp" style="color:orange;font-weight:bold">企业管理系统</a>
    </div>

    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li><a href="login.jsp" style="color:blue;font-size:16px">欢迎${requestScope.manager.admin}进入<span class="sr-only">(current)</span></a></li>
      </ul>
      
      <ul class="nav navbar-nav navbar-right">
        <li><a href="login.jsp">退出登录</a></li>
      </ul>
    </div>
  </div>
</nav>

<div class="row">
	<div class="col-md-2" style="margin-left:30px">
		<%@include file="menu.jsp"%>
	</div>
	
	<div class="col-md-8">
		<div class="panel panel-default">
		  <div class="panel-heading">
		  <c:if test="${requestScope.flag!=null }">
			  	<c:if test="${requestScope.flag==true }">
			  	  <div style="width:100%;text-align:center;">
			  		<span style="color:green;font-size:16px">更新成功</span>
			  	  </div>
			  	</c:if>
			  	<c:if test="${requestScope.flag==false }">
			  	  <div class="form-group">
			  	    <span style="color:green">更新失败</span>
			   	  </div>
			  	</c:if>
			  </c:if>
		    <h3 class="panel-title">更新用户</h3>
		  </div>
		  <div class="panel-body">
		    <form class="form-horizontal" id="forform" action="UpdateUserServlet" method="post">
			  <input type="hidden" value="${requestScope.user.id }" name="id">
			  <div class="form-group">
			    <label class="col-sm-2 control-label">姓名</label>
			    <div class="col-sm-10">
			      <input type="text" class="form-control" id="forname" value="${requestScope.user.name }" name="name" placeholder="请输入姓名">
			    </div>
			  </div>
			  <div class="form-group">
			    <label class="col-sm-2 control-label">年龄</label>
			    <div class="col-sm-10">
			      <input type="number" class="form-control" id="forage" value="${requestScope.user.age }" name="age" placeholder="请输入年龄">
			    </div>
			  </div>
			  <div class="form-group">
			    <label class="col-sm-2 control-label">性别 </label>
			    <c:if test="${requestScope.user.sex==0 }">
				    <label class="radio-inline">
					  <input type="radio" name="sex" id="male" value="1">男
					</label>
					<label class="radio-inline">
					  <input type="radio" name="sex" id="female" value="0" checked="checked">女
					</label>
			    </c:if>
				<c:if test="${requestScope.user.sex==1 }">
				    <label class="radio-inline">
					  <input type="radio" name="sex" id="male" value="1" checked="checked">男
					</label>
					<label class="radio-inline">
					  <input type="radio" name="sex" id="female" value="0">女
					</label>
			    </c:if>
			  </div>
			  <div class="form-group">
			    <label class="col-sm-2 control-label">部门</label>
			    <div class="col-sm-10">
			      <select class="form-control" name="did" id="fordid">
			        <option value=-1>--请选择--</option>
			      	<c:forEach items="${requestScope.list }" var="item">
			      	  <!--<c:if test="${item.id==requestScope.user.did }">
			      	    <option value="${item.id }" selected="selected">${item.name }</option>
			      	  </c:if>
			      	  <c:if test="${item.id!=requestScope.user.did }">
			      		<option value="${item.id }">${item.name }</option>
			      	  </c:if>-->
			      	  <c:choose><c:when test="${item.id==requestScope.user.did }">
			      	    <option value="${item.id }" selected="selected">${item.name }</option>
			      	  </c:when>
			      	  <c:otherwise>
			      		<option value="${item.id }">${item.name }</option>
			      	  </c:otherwise></c:choose>
			      	</c:forEach>
				</select>
			    </div>
			  </div>
			  <div style="text-align:center"><button type="button" class="btn btn-success" id="submitbtn">提交</button></div>
		   </form>
		  </div>
		</div>
	</div>
</div>
<script>


</script>
</body>
</html>